<?php

namespace app\mini\ui\form;

use app\mini\enum\TypeEnum;
use app\mini\model\MiniAdvPos;
use app\mini\model\MiniPath;

/**
 * 广告管理表单
 */
class MiniAdvForm
{
    public function title()
    {
        return array(
            'type' => 'input',
            'title' => '广告名称',
            'field' => 'title',
            'validate' => [
                [
                    'required' => true,
                    'message' => '不能为空',
                ],
            ],
        );
    }

    public function path()
    {
        return array(
            'type' => 'radio',
            'options' => MiniPath::buildMiniOptions(),
            'title' => '菜单路径',
            'field' => 'path',
            'validate' => [
                [
                    'required' => true,
                    'message' => '不能为空',
                ],
            ],
        );
    }

    public function pos()
    {
        return array(
            'type' => 'radio',
            'options' => MiniAdvPos::buildPosOptions(),
            'title' => '广告位置',
            'field' => 'pos',
            'validate' => [
                [
                    'required' => true,
                    'message' => '不能为空',
                ],
            ],
        );
    }

    public function start_time()
    {
        return array(
            'type' => 'dateTime',
            'title' => '开始时间',
            'field' => 'start_time',
            'validate' => [
                [
                    'required' => true,
                    'message' => '不能为空',
                ],
            ],
        );
    }

    public function end_time()
    {
        return array(
            'type' => 'dateTime',
            'title' => '结束时间',
            'field' => 'end_time',
            'validate' => [
                [
                    'required' => true,
                    'message' => '不能为空',
                ],
            ],
        );
    }

    public function inx()
    {
        return [
            'type' => 'number',
            'title' => '排序',
            'field' => 'inx',
            'value' => 100,
        ];
    }
}